<?php
require_once 'config.php'; 

$host = $config['host'];
$name = $config['name'];
$pwd = $config['pwd'];
$dbname = $config['dbname'];

$conn = new mysqli($host, $name, $pwd, $dbname);

// 检测连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
} 